package cn.lau.pp.module.vr.dal.mysql.game;

import java.util.*;

import cn.lau.pp.framework.common.pojo.PageResult;
import cn.lau.pp.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lau.pp.framework.mybatis.core.mapper.BaseMapperX;
import cn.lau.pp.module.vr.dal.dataobject.game.GameDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lau.pp.module.vr.controller.admin.game.vo.*;

/**
 * vr游戏 Mapper
 *
 * @author Lau
 */
@Mapper
public interface GameMapper extends BaseMapperX<GameDO> {

    default PageResult<GameDO> selectPage(GamePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GameDO>()
                .likeIfPresent(GameDO::getName, reqVO.getName())
                .eqIfPresent(GameDO::getUrl, reqVO.getUrl())
                .eqIfPresent(GameDO::getStatus, reqVO.getStatus())
                .eqIfPresent(GameDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(GameDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(GameDO::getId));
    }

}